//
//  GPVideoView.h
//  Keping
//
//  Created by 23 on 2017/12/10.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GPVideoToolView.h"

@class GPVideoView;
@protocol GPVideoViewDelegate <NSObject>

/**语音通话时长label*/
@property(nonatomic,weak,readonly) IBOutlet UILabel *voiceTimeLabel;

#pragma mark - 按钮操作 - 未接通
//被叫 - 拒绝
- (void)videoView:(GPVideoView *)videoView didRejectBtnClicked:(KLVideoCallButton *)rejectButton;
//被叫 - 接听
- (void)videoView:(GPVideoView *)videoView didReceiveBtnClicked:(KLVideoCallButton *)receiveButton;
//主叫 - 取消
- (void)videoView:(GPVideoView *)videoView didCancelCalling:(KLVideoCallButton *)rejectButton;

#pragma mark - 按钮操作 - 接通状态
//接通中 - 缩小放大
- (void)videoView:(GPVideoView *)videoView isMinisizeWindow:(BOOL )isMinisize;
//接通中 - 主动挂断
- (void)videoView:(GPVideoView *)videoView didHangupSession:(KLVideoCallButton *)rejectButton;
//接通中 - 切换摄像头
- (void)videoView:(GPVideoView *)videoView didChangeCamera:(UIButton *)changeButton;
//接通中 - 视频切换成语音
- (void)videoView:(GPVideoView *)videoView didSwitchToVoice:(UIButton *)switchButton;
//接通中 - 免提
- (void)videoView:(GPVideoView *)videoView didHandsOff:(BOOL)isHandsOff;
//接通中 - 静音
- (void)videoView:(GPVideoView *)videoView didSlienceVoice:(BOOL)isSlience;

@end


@interface GPVideoView : UIView

/**根据状态加载view*/
+ (instancetype)videoView;

//恢复UI
- (void)recoveryUI;
/**根据通话状态更新UI*/
- (void)updateUIWithStatus:(GPVideoViewStatus )status;
/**更新对方姓名和头像*/
- (void)updateUserInfoWithName:(NSString *)name avator:(UIImage *)avatorImage avatorPath:(NSString *)avatorPath;
/**更新语音通话时长(单位是秒)*/
- (void)updateVoiceTimesecond:(double)time;

/**代理*/
@property(nonatomic,weak) id<GPVideoViewDelegate> delegate;

@end
